﻿<html>
<head><title>Hebrew Tooltip Translations Options</title>
<script type="text/javascript">
// Saves options to localStorage.
function save_options() {
  var options = {'trigger_hover' : document.getElementById("HTTTriggerHover").checked,
                  'HTTtooltipDelay' : document.getElementById("HTTTriggerHoverDelay").value,

                  'trigger_click' : document.getElementById("HTTTriggerClick").checked,
                  'trigger_click_ctrl' : document.getElementById("HTTTriggerClickCtrl").checked,
                  'trigger_click_alt' : document.getElementById("HTTTriggerClickAlt").checked,
                  'trigger_click_shift' : document.getElementById("HTTTriggerClickShift").checked,

                  'trigger_highlight' : document.getElementById("HTTTriggerHighlight").checked,
                  'trigger_highlight_ctrl' : document.getElementById("HTTTriggerHighlightCtrl").checked,
                  'trigger_highlight_alt' : document.getElementById("HTTTriggerHighlightAlt").checked,
                  'trigger_highlight_shift' : document.getElementById("HTTTriggerHighlightShift").checked,

                  'trigger_keyboard' : document.getElementById("HTTTriggerKeyboard").checked,
                  'trigger_keyboard_ctrl' : document.getElementById("HTTTriggerKeyboardCtrl").checked,
                  'trigger_keyboard_alt' : document.getElementById("HTTTriggerKeyboardAlt").checked,
                  'trigger_keyboard_shift' : document.getElementById("HTTTriggerKeyboardShift").checked,
                  'HTTtooltipCharacter' : document.getElementById("HTTTriggerKeyboardCharacter").value,

                  'hide_move' : document.getElementById("HTTHideMove").checked,
                  'hide_click' : document.getElementById("HTTHideClick").checked,
                  'hide_scroll' : document.getElementById("HTTHideScroll").checked,
                  'hide_keyboard' : document.getElementById("HTTHideKeyboard").checked,

                  'align_top' : document.getElementById("HTTLocationY1").checked,
                  'align_left' : document.getElementById("HTTLocationX1").checked,
                  'keep_on_screen' : document.getElementById("HTTKeepOnScreen").checked,
                  
                  'activity_indicator' : document.getElementById("HTTActivityIndicator").checked};
  localStorage["options"] = JSON.stringify(options);
}

// Restores select box state to saved value from localStorage.
function restore_options() {
  var options = localStorage['options'] && JSON.parse(localStorage['options']);
  if (!options) {
    options = {};
  }
  if(options['trigger_hover'] == undefined) options['trigger_hover'] = 1;
  if(options['HTTtooltipDelay'] == undefined) options['HTTtooltipDelay'] = 1000;

  if(options['trigger_click'] == undefined) options['trigger_click'] = 0;
  if(options['trigger_click_ctrl'] == undefined) options['trigger_click_ctrl'] = 0;
  if(options['trigger_click_alt'] == undefined) options['trigger_click_alt'] = 0;
  if(options['trigger_click_shift'] == undefined) options['trigger_click_shift'] = 0;
  
  if(options['trigger_highlight'] == undefined) options['trigger_highlight'] = 0;
  if(options['trigger_highlight_ctrl'] == undefined) options['trigger_highlight_ctrl'] = 0;
  if(options['trigger_highlight_alt'] == undefined) options['trigger_highlight_alt'] = 0;
  if(options['trigger_highlight_shift'] == undefined) options['trigger_highlight_shift'] = 0;

  if(options['trigger_keyboard'] == undefined) options['trigger_keyboard'] = 0;
  if(options['trigger_keyboard_ctrl'] == undefined) options['trigger_keyboard_ctrl'] = 0;
  if(options['trigger_keyboard_alt'] == undefined) options['trigger_keyboard_alt'] = 0;
  if(options['trigger_keyboard_shift'] == undefined) options['trigger_keyboard_shift'] = 0;
  if(options['HTTtooltipCharacter'] == undefined) options['HTTtooltipCharacter'] = 'T';

  if(options['hide_move'] == undefined) options['hide_move'] = 1;
  if(options['hide_click'] == undefined) options['hide_click'] = 1;
  if(options['hide_scroll'] == undefined) options['hide_scroll'] = 1;
  if(options['hide_keyboard'] == undefined) options['hide_keyboard'] = 1;

  if(options['align_top'] == undefined) options['align_top'] = 1;
  if(options['align_left'] == undefined) options['align_left'] = 1;
  if(options['keep_on_screen'] == undefined) options['keep_on_screen'] = 1;
  
  if(options['activity_indicator'] == undefined) options['activity_indicator'] = 1;

  document.getElementById("HTTTriggerHover").checked = options['trigger_hover'];
  document.getElementById("HTTTriggerHoverDelay").value = options['HTTtooltipDelay'];

  document.getElementById("HTTTriggerClick").checked = options['trigger_click'];
  document.getElementById("HTTTriggerClickCtrl").checked = options['trigger_click_ctrl'];
  document.getElementById("HTTTriggerClickAlt").checked = options['trigger_click_alt'];
  document.getElementById("HTTTriggerClickShift").checked = options['trigger_click_shift'];

  document.getElementById("HTTTriggerHighlight").checked = options['trigger_highlight'];
  document.getElementById("HTTTriggerHighlightCtrl").checked = options['trigger_highlight_ctrl'];
  document.getElementById("HTTTriggerHighlightAlt").checked = options['trigger_highlight_alt'];
  document.getElementById("HTTTriggerHighlightShift").checked = options['trigger_highlight_shift'];

  document.getElementById("HTTTriggerKeyboard").checked = options['trigger_keyboard'];
  document.getElementById("HTTTriggerKeyboardCtrl").checked = options['trigger_keyboard_ctrl'];
  document.getElementById("HTTTriggerKeyboardAlt").checked = options['trigger_keyboard_alt'];
  document.getElementById("HTTTriggerKeyboardShift").checked = options['trigger_keyboard_shift'];
  document.getElementById("HTTTriggerKeyboardCharacter").value = options['HTTtooltipCharacter'];

  document.getElementById("HTTHideMove").checked = options['hide_move'];
  document.getElementById("HTTHideClick").checked = options['hide_click'];
  document.getElementById("HTTHideScroll").checked = options['hide_scroll'];
  document.getElementById("HTTHideKeyboard").checked = options['hide_keyboard'];

  document.getElementById("HTTLocationY1").checked = options['align_top'];
  document.getElementById("HTTLocationX1").checked = options['align_left'];
  document.getElementById("HTTLocationY0").checked = !options['align_top'];
  document.getElementById("HTTLocationX0").checked = !options['align_left'];
  document.getElementById("HTTKeepOnScreen").checked = options['keep_on_screen'];
  
  document.getElementById("HTTActivityIndicator").checked = options['activity_indicator'];
}

</script></head>
<body onload="restore_options()">
  <img src="HTT-128.png"><br />
  <h1>Hebrew Tooltip Translation for Google Chrome™</h1>
  <a href='http://code.google.com/p/hebrew-tooltip-translations-for-chrome/'>Project homepage</a>
  <a href='http://code.google.com/p/hebrew-tooltip-translations-for-chrome/issues/list'>Report problems</a><br />
    <h2>Show translation</h2>
      <input type="checkbox" id="HTTTriggerHover"/><label for="HTTTriggerHover">Show Tooltip after hovering </label><input type="text" id="HTTTriggerHoverDelay"/><label for="HTTTriggerHover"> milliseconds</label><br />

      <input type="checkbox" id="HTTTriggerClick"/><label for="HTTTriggerClick">Show Tooltip after clicking on a word</label><br />
      &nbsp; &nbsp; <input type="checkbox" id="HTTTriggerClickCtrl"/><label for="HTTTriggerClickCtrl">With Ctrl</label><br />
      &nbsp; &nbsp; <input type="checkbox" id="HTTTriggerClickAlt"/><label for="HTTTriggerClickAlt">With Alt</label><br />
      &nbsp; &nbsp; <input type="checkbox" id="HTTTriggerClickShift"/><label for="HTTTriggerClickShift">With Shift</label><br />

      <input type="checkbox" id="HTTTriggerHighlight"/><label for="HTTTriggerHighlight">Show Tooltip after selecting a word or phrase</label><br />
      &nbsp; &nbsp; <input type="checkbox" id="HTTTriggerHighlightCtrl"/><label for="HTTTriggerHighlightCtrl">With Ctrl</label><br />
      &nbsp; &nbsp; <input type="checkbox" id="HTTTriggerHighlightAlt"/><label for="HTTTriggerHighlightAlt">With Alt</label><br />
      &nbsp; &nbsp; <input type="checkbox" id="HTTTriggerHighlightShift"/><label for="HTTTriggerHighlightShift">With Shift</label><br />

      <input type="checkbox" id="HTTTriggerKeyboard"/><label for="HTTTriggerKeyboard">Show Tooltip after pressing </label><input type="text" id="HTTTriggerKeyboardCharacter"/><label for="HTTTriggerKeyboard"> (or leave empty to show tooltip with just Ctrl, Alt, Shift, etc.)</label><br />
      &nbsp; &nbsp; <input type="checkbox" id="HTTTriggerKeyboardCtrl"/><label for="HTTTriggerKeyboardCtrl">With Ctrl</label><br />
      &nbsp; &nbsp; <input type="checkbox" id="HTTTriggerKeyboardAlt"/><label for="HTTTriggerKeyboardAlt">With Alt</label><br />
      &nbsp; &nbsp; <input type="checkbox" id="HTTTriggerKeyboardShift"/><label for="HTTTriggerKeyboardShift">With Shift</label><br />

    <h2>Hide translation</h2>
      <input type="checkbox" id="HTTHideMove"/><label for="HTTHideMove">Hide Tooltip after moving mouse</label><br />
      <input type="checkbox" id="HTTHideClick"/><label for="HTTHideClick">Hide Tooltip after clicking mouse</label><br />
      <input type="checkbox" id="HTTHideScroll"/><label for="HTTHideClick">Hide Tooltip after scrolling mousewheel</label><br />
      <input type="checkbox" id="HTTHideKeyboard"/><label for="HTTHideKeyboard">Hide Tooltip after any keyboard button</label><br />

    <h2>Translation Location</h2>
      <span class="HTTHeader">Relative to mouse cursor</span><br />
      &nbsp; &nbsp; <input type="radio" name="HTTLocationX" id="HTTLocationX0" value="0" /><label for="HTTLocationX0">To the left</label>
      &nbsp; &nbsp; <input type="radio" name="HTTLocationX" id="HTTLocationX1" value="1" /><label for="HTTLocationX1">To the right</label><br />
      &nbsp; &nbsp; <input type="radio" name="HTTLocationY" id="HTTLocationY1" value="1" /><label for="HTTLocationY1">Below</label>
      &nbsp; &nbsp; <input type="radio" name="HTTLocationY" id="HTTLocationY0" value="0" /><label for="HTTLocationY0">Above</label><br />
      <input type="checkbox" id="HTTKeepOnScreen"/><label for="HTTKeepOnScreen">Keep Tooltips on screen</label><br />
      
    <h2>While Translating</h2>
      <input type="checkbox" id="HTTActivityIndicator"/><label for="HTTActivityIndicator">Show activity indicator</label><br />
    <button onclick="save_options()">Save</button>
</body>
</html>
